//-------------------------------------------------------------------------------
//	@file CWaveFileHeader.h
//	@brief
// 		A tiny class used to create a wave-file header
//
//	$Id: $
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
//	Copyright and Disclaimer Notice
//
//	Copyright (c) 2013-2014 A.C. Verbeck
//	original author: Michel Helms (MichelHelms@Web.de).
//
//	This file is part of AudioCD: Audio CD reader
//
//	AudioCD is free software: you can redistribute it and/or modify
//	it under the terms of the GNU General Public License as published by
//	the Free Software Foundation, either version 3 of the License, or
//	(at your option) any later version.
//
//	AudioCD is distributed in the hope that it will be useful,
//	but WITHOUT ANY WARRANTY; without even the implied warranty of
//	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//	GNU General Public License for more details.
//
//	You should have received a copy of the GNU General Public License
//	along with AudioCD.  If not, see <http://www.gnu.org/licenses/>.
//
//------------------------------------------------------------------------------

// A tiny class that helps us creating the header of a wave-file.
class CWaveFileHeader
{
public:
	CWaveFileHeader();
	CWaveFileHeader(ULONG SamplingRate, USHORT BitsPerSample, USHORT Channels, ULONG DataSize);
	void Set(ULONG SamplingRate, USHORT BitsPerSample, USHORT Channels, ULONG DataSize);

private:
	UCHAR  m_Riff_ID[4];		//'RIFF'
	ULONG  m_Riff_Size;			// FileSize-8
	UCHAR  m_Riff_Type[4];		// 'WAVE'

	UCHAR  m_Fmt_ID[4];			// 'FMT '
	ULONG  m_Fmt_Length;		// 16
	USHORT m_Fmt_Format;		// 1 (=MS PCM)
	USHORT m_Fmt_Channels;		// 1 = mono, 2 = stereo
	ULONG  m_Fmt_SamplingRate;	// Abtastrate pro Sekunde (z.B. 44100)
	ULONG  m_Fmt_DataRate;		// SamplingRate * BlockAlign
	USHORT m_Fmt_BlockAlign;	// Channels * BitsPerSample / 8
	USHORT m_Fmt_BitsPerSample;	// 8 or 16

	UCHAR  m_Data_ID[4];		// 'data'
	ULONG  m_Data_DataSize;		// Size of the following data
};

//
//	End: CWaveFileHeader.h
//
